{extend name="upload/editing"}

{block name="mycss"}
{css href="/static/index/css/upload_333cb5e9a7ec46dd.css"}
{css href="/static/index/css/newpic.css"}
{css href="/static/index/css/newpic1.css"}
<!-- {js href="/static/index/js/gdtevent.min.js"} -->
{/block}


{block name="main1"}
<div class="showDetail-container  YC-type OGC-type">
    <div class="showDetail-header">
        <div class="detailHeader-wrap">
            <div class="w1200 clearfix " >
                <div class="fr clearfix">
                    <div class="fr clearfix detail-down">
                        <div class="detailBtn-down download-page fl" sta-site="6" data-id="28837922" stats-point="101">
                            <i class="icon icon-loadown"></i><a href="{:url('index/download/dodown',['icon'=>$data['icon'],'id'=>$data['id'],'dw_num'=>$dw_num])}" style="color:#fff;"  class="d-btn" down-num="{$dw_num}">VIP免费下载</a>
                        </div>
                        {if $Think.session.uid}
                            {if condition="$userinfo['collstatus']"}
                                <div class="house-btn detailBtn-fav fl handle-fav" sta-site="7"  data-action="addFav" stats-point="102">
                                    <i class="icon icon-shoucang coll-btn" data-id="{$data['id']}" style="color: red"></i>
                                </div>
                            {else/}
                                <div class="house-btn detailBtn-fav fl handle-fav" sta-site="7" data-id="{$data['id']}" data-action="addFav" stats-point="102">
                                    <i class="icon icon-shoucang coll-btn" data-id="{$data['id']}" ></i>
                                </div>
                            {/if}
                        {else/}
                            <div class="house-btn detailBtn-fav fl handle-fav" sta-site="7" data-id="{$data['id']}" data-action="addFav" stats-point="102">
                                <i class="icon icon-shoucang msg-btn" ></i>
                            </div>
                        {/if}
                    </div>
                    <div class="detailPic-infoList fr"><i class="icon icon-loadown"></i><span id="s_dnum">{$sold}</span>
                    </div>
                    <div class="detailPic-infoList fr"><i class="icon icon-shoucang"></i><span id="s_fav">{$data['house']}</span>
                    </div>
                    <div class="detailPic-infoList fr"><i class="icon icon-liulan"></i><span id="s_readnum">{$look}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="showDetail-main w1200 clearfix">
        <div class="main-left fl">
            <div class="mainLeft-title">
                <div class="pic-type"><i class="pic-type-icon"></i>原创</div>
                官方授权可商用100%正版作品。成为原创VIP即可享受免费海量下载，低至每天0.18元。
                <a href="{:url('index/vip/index')}" class="alert-color " data-mark-header="d_w_l" sta-site="4" stats-point="106" rel="nofollow" target="_blank">点击了解详细 &gt;&gt;</a>
            </div>
            <div class="mainLeft-title " style="margin-top: 20px">
                <p style="font-size: 20px">描述:{$data['desc']}</p>
            </div>
            <div class="mainLeft-pics">
                <div id="show-area-height" style="width: 100%;">
                    <img src="http://pdyc9epam.bkt.clouddn.com/{$data['icon']}?imageMogr2/format/jpg/blur/1x0/quality/75|watermark/1/image/aHR0cDovL3BkeWM5ZXBhbS5ia3QuY2xvdWRkbi5jb20vMjAxODA5MTA1Yjk2MzA5Yzk5YWY5LnBuZw==/dissolve/73/gravity/Center/dx/10/dy/10|imageslim" class="show-area-pic" id="show-area-pic" alt="复古手绘花朵创意装饰画" title="复古手绘花朵创意装饰画" width="650" width="780px" data-toggle="modal" data-target="#myModal" >

                </div>
            </div><!--end images-->
            <div class="combine2"><a>登录查看更多精彩内容<i></i></a></div>
        </div>
        <div class="main-right fr">
            <div class="mainRight-file">
                <div class="file-logo psd"><img src="/static/index/images/imglog.png" width="70px" height="70px">
                </div>
                <p>文件格式：{$data['ext']}</p>
                </div>
            <p>编号：{$data['id']}</p>
            <p>下载量:{$sold}次</p>
            <p>模式：RGB</p>
            <p>体积：{$data['size']}KB</p>
            <p> 肖像权/物权：未获得模特肖像权或所有物权授权</p>
            <p> 版权所有：@云图网</p>
            <div class="mainRight-user clearfix">
                <div class="fl">
                    <a href="{:url('index/details/home',['uid'=>$data['uid']])}" class="fl user-img" title="TA的个人主页" target="_blank" rel="nofollow">
                            {if condition = "$icon"}
                            <img class="head-img2" src="http://pdyc9epam.bkt.clouddn.com/{$icon}" width="80" height="80" alt="">
                            {else/}
                            <img class="head-img2" src="/static/default.jpg" width="80" height="80" alt="">
                            {/if}
                       </a>
                    <div class="user-box fl">
                        <div>
                            <a href="#" title="TA的个人主页" target="_blank" rel="nofollow">{$name}</a>
                        </div>
                    </div>
                    <div class="user-detail" >
                        <a href="#">
                            {if condition = "$icon"}
                            <img class="head-img2" src="http://pdyc9epam.bkt.clouddn.com/{$icon}" width="80" height="80" alt="">
                            {else/}
                            <img class="head-img2" src="static/default.jpg" width="80" height="80" alt="">
                            {/if}
                        </a>
                        <div class="detail-name">
                            <a href="#">{$name}</a>
                        </div>
                        <div class="clearfix detail-count">
                            <div class="fl">
                                <a href="#"><span>创作</span><br><span>{$userinfo['goodscount']}</span></a>
                            </div>
                            <div class="fr">
                                <a href="#"><span>粉丝</span><br><span class="fanscount">{$userinfo['fanscount']}</span></a>
                            </div>
                        </div>
                        <!--动态个人主页-->
                        <div class="detail-btnGroup" >
                            <a href="{:url('index/details/home',['uid'=>$data['uid']])}" class="detail-home fl" title="TA的个人主页" target="_blank" rel="nofollow" sta-site="16" stats-point="116">查看主页</a>
                            {if condition="empty($Think.session.uid)"}
                                    <a  class=" user-btn js-gz cure fr" href="{:url('index/login/index')}">登录</a>
                                {elseif condition="empty($userinfo.status)"/}
                                    <div class="att-btn user-btn js-gz cure fr" data-id="{$data['uid']}" sta-site="3" stats-point="105">关注</div>
                                {else /}
                                    <div class="att-btn user-btn js-gz cure fr" data-id="{$data['uid']}" sta-site="3" stats-point="105">取消关注</div>
                            {/if}
                        </div>
                        <!--END动态个人主页-->

                    </div>
                </div>
                {if condition="empty($Think.session.uid)"}
                        <a  class=" user-btn js-gz cure fr" href="{:url('index/login/index')}">登录</a>
                    {elseif condition="empty($userinfo.status)"/}
                        <div class="att-btn user-btn js-gz cure fr" data-id="{$data['uid']}" sta-site="3" stats-point="105">关注</div>
                    {else /}
                        <div class="att-btn user-btn js-gz cure fr" data-id="{$data['uid']}" sta-site="3" stats-point="105">取消关注</div>
                {/if}
            </div>
            <div class="mainRight-picTitle clearfix"><span class="fl">TA的相关作品</span>

                <a href="{:url('index/details/home',['uid'=>$data['uid']])}" class="fr" target="_blank" sta-site="14" stats-point="120">查看更多</a>
            </div>

            <div class="mainRight-picDetail clearfix">
                {volist name="list" id="cc"}
                <a href="{:url('index/details/newpic',['id'=>$cc['id']])}" sta-site="15" stats-point="121" class="fl">
                <img src="http://pdyc9epam.bkt.clouddn.com/{$cc['icon']}?imageMogr2/thumbnail/!20p/gravity/Center/crop/120x160/format/jpg/blur/1x0/quality/75|imageslim" alt="" width="120px" height="160px">
                </a>
                {/volist}
            </div>
            </div>

            <div class="mainRight-inform"></div></div>
    </div>
</div>



<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="width:1000px;margin-left:-200px">
            <div class="modal-body">
                <img src="http://pdyc9epam.bkt.clouddn.com/{$data['icon']}?imageMogr2/format/jpg/blur/1x0/quality/75|watermark/1/image/aHR0cDovL3BkeWM5ZXBhbS5ia3QuY2xvdWRkbi5jb20vMjAxODA5MTA1Yjk2MzA5Yzk5YWY5LnBuZw==/dissolve/73/gravity/Center/dx/10/dy/10|imageslim" width="100%">
            </div>
        </div>
    </div>
</div>

{/block}




{block name="myjs"}
<script>

    $('#show-area-height').click(function(){
        console.log(1);
    })

    $('.d-btn').click(function(){
        if($(this).attr('down-num')=='0'){
            alert('当天下载次数已用完,开通VIP不限量下载');
        return false;
        }
        if($(this).attr('down-num')=='1'){
            $(this).attr('down-num','0');
        }
    })


    //执行关注和取消关注

    $('.att-btn').click(function(){
        var fid=$(this).attr('data-id');
        var fanscount = $('.fanscount').html();
        attAjax(fid,fanscount);
    })
    function attAjax(fid,fanscount)
    {   
        $.ajax({
            type:'post',
            dataType:'json',
            data:{'fid':fid},
            url:'/attention',
            success:function(data){
                if(data.status){
                    toastr.success('关注成功');
                    $('.fanscount').html(parseInt(fanscount)+1);
                    $('.att-btn').html('取消关注');
                }else{
                    toastr.success('取关成功');
                    $('.fanscount').html(parseInt(fanscount)-1);
                    $('.att-btn').html('点击关注');
                }
            },
            error:function(){
                toastr.error('网络错误,请重试');
            }
        })
    }

    //执行收藏和取消收藏
    $('.coll-btn').click(function(){
        var gid = $(this).attr("data-id");
        var collcount = $('#s_fav').html();
        collectAjax(gid,collcount);
    });

    function collectAjax(gid,collcount)
    {
        $.ajax({
            type:'get',
            dataType:'json',
            data:{'gid':gid},
            url:'/docollect',
            success:function(data){
                if(data.status){
                    toastr.success(data.info);
                    $('.coll-btn').css('color','#000');
                    $('#s_fav').html(parseInt(collcount)-1);
                }else{
                    toastr.success(data.info);
                    $('.coll-btn').css('color','red');
                    $('#s_fav').html(parseInt(collcount)+1);
                }
            },
            error:function(){
                toastr.error('网络错误');
            }
        });
        }
    $('.msg-btn').click(function(){
        toastr.error('请登录后再试');
    });
</script>
{/block}
